import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'text_logic.dart';

class TextPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final logic = Get.put(TextLogic());
    final state = Get.find<TextLogic>().state;

    return Scaffold(
        appBar: AppBar(title: const Text('计数器-简单式')),
        body: Center(
          child: GetBuilder<TextLogic>(builder: (logic) {
            return Text(
              '点击了 ${logic.count} 次',
              style: const TextStyle(fontSize: 30.0),
            );
          }),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () => logic.increase(),
          child: const Icon(Icons.add),
        ),


    );
  }
}
